<?php
//redis ����
$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
//����





$redis->set('test', 'hello redis');
echo $redis->get('test');
$redis->set('test2', 'hello redis2');
echo $redis->get('test2');
$redis->del('test2');




echo '<br>';
$redis->lpush("tutorial-list", "Redis");
$redis->lpush("tutorial-list", "Mongodb");
$redis->lpush("tutorial-list", "Mysql");
$arList = $redis->lrange("tutorial-list", 0, 5);
echo "Stored string in redis:: ";
print_r($arList);



$rList = $redis->keys("*");
echo "Stored keys in redis:: ";
print_r($rList);



$a =array('a'=>'a','b'=>'b');
$b=array('a');
$redis->hMset('h',$a);

var_dump($redis->hMGet('h',$b));
var_dump($redis->hGetAll('h'));






$redis->sAdd('xx','a','b');



$rList = $redis->keys("*");
echo "Stored keys in redis:: ";
print_r($rList);